<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt"  uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="${pageContext.request.contextPath }/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/h-ui/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/h-ui/lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/h-ui/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath }/h-ui/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
<title>添加面料</title>
</head>
<body>
<body onload="uploadSingleImg('${pageContext.request.contextPath }/upload/upload')">
<div class="pd-20">
	<form action="" method="post" class="form form-horizontal" id="add_Fabric_Form">
		<div class="row cl">
	        <label class="form-label col-1"><span class="c-red">*</span>类型：</label>
	        <div class="formControls col-2">
	        	<span class="select-box" style="width:150px;">
		            <select id="fType" name="fType" class="select" datatype="*">
		       			<option value="">请选择</option>
		       			<option value="1">面料目录</option>
	   					<option value="2">版布开发</option>
	   					<option value="3">开发样本</option>
					</select>
				</span>
           </div>
           <div class="col-1"> </div>
           <label class="form-label col-1"><span class="c-red">*</span>货源：</label>
	        <div class="formControls col-2">
	        	<span class="select-box" style="width:150px;">
		            <select id="fState" name="fState" class="select" datatype="*">
		       			<option value="">请选择</option>
		       			<option value="0">现货区</option>
	   					<option value="1">订货区</option>
	   					<option value="2">印花底布</option>
					</select>
				</span>
           </div>
           <div class="col-1"> </div>
       </div>
       <div class="row cl">
           <label class="form-label col-1"><span class="c-red">*</span>名称（中文）：</label>
           <div class="formControls col-2">
           		<input type="text" class="input-text" value="" placeholder="请输入名称" id="fName" name="fName" datatype="*" nullmsg="名称不能为空">
           </div>
           <div class="col-1"> </div>
           <label class="form-label col-1"><span class="c-red">*</span>名称（英文）：</label>
           <div class="formControls col-2">
           		<input type="text" class="input-text" value="" placeholder="请输入名称" id="fMessage1" name="fMessage1" datatype="*" nullmsg="名称不能为空">
           </div>
           <div class="col-1"> </div>
       </div>
       <div class="row cl">
       	   <label class="form-label col-1"><span class="c-red">*</span>生产地（中文）：</label>
           <div class="formControls col-2">
               <input type="text" class="input-text" value="" placeholder="" id="fOrigin" name="fOrigin" datatype="*" nullmsg="生产地不能为空">
           </div>
           <div class="col-1"> </div>
           <label class="form-label col-1"><span class="c-red">*</span>生产地（英文）：</label>
           <div class="formControls col-2">
               <input type="text" class="input-text" value="" placeholder="" id="fMessage2" name="fMessage2" datatype="*" nullmsg="生产地不能为空">
           </div>
           <div class="col-1"> </div>
       </div>
       <div class="row cl">
           <label class="form-label col-1"><span class="c-red">*</span>编号：</label>
           <div class="formControls col-2">
               <input type="text" class="input-text" value="" placeholder="请输入编号" id="fNo" name="fNo" datatype="*" nullmsg="编号不能为空" ajaxurl="${pageContext.request.contextPath }/admin/fabric/isNoExits" errormsg="编号已存在！！">
           </div>
           <div class="col-1"> </div>
           <label class="form-label col-1"><span class="c-red">*</span>克重：</label>
           <div class="formControls col-2">
               <input type="text" class="input-text" id="fGProperty" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" name="fGProperty" datatype="*"style="width:70%;" nullmsg="克重不能为空">
           		<label style="display: inline;">克</label>
           </div>
           <div class="col-1"> </div>
       </div>
       <div class="row cl">
       	   <label class="form-label col-1"><span class="c-red">*</span>原料：</label>
           <div class="formControls col-2">
               <input type="text" class="input-text" id="fMaterial" name="fMaterial" datatype="*" nullmsg="原料不能为空">
           </div>
           <div class="col-1"> </div>
           <label class="form-label col-1"><span class="c-red">*</span>门封：</label>
           <div class="formControls col-2">
               <input type="text" class="input-text" id="fOrdinary" name="fOrdinary" datatype="*" nullmsg="门封不能为空">
           </div>
           <div class="col-1"> </div>
       </div>
       <div class="row cl">
       	   <label class="form-label col-1"><span class="c-red">*</span>价格：</label>
           <div class="formControls col-2">
               <input type="text" class="input-text" t_value="" o_value="" onkeypress="if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/))this.value=this.t_value;else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value" onkeyup="if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/))this.value=this.t_value;else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value" onblur="if(!this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?|\.\d*?)?$/))this.value=this.o_value;else{if(this.value.match(/^\.\d+$/))this.value=0+this.value;if(this.value.match(/^\.$/))this.value=0;this.o_value=this.value}" id="fPrice" name="fPrice" datatype="*" nullmsg="价格不能为空" style="width:70%;">
           	   <label style="display: inline;">元/米</label>
           </div>
           <div class="col-1"> </div>
           <label class="form-label col-1"><span class="c-red">*</span>成分：</label>
           <div class="formControls col-2">
           		<span class="select-box" style="width:150px;">
		            <select id="fIngredients" name="fIngredients" class="select" datatype="*">
		       			<option value="">请选择</option>
		       			<c:forEach items="${ffList }" var="list">
		       				<c:if test="${list.ffParentId==1 }">
		       					<option value="${list.ffId }">${list.ffName }</option>
		       				</c:if>
		           		</c:forEach>
					</select>
				</span>
           </div>
           <div class="col-1"> </div>
       </div>
       <div class="row cl">
       	   <label class="form-label col-1"><span class="c-red">*</span>制造：</label>
           <div class="formControls col-2">
           		<span class="select-box" style="width:150px;">
		            <select id="fWeaving" name="fWeaving" class="select" datatype="*">
		       			<option value="">请选择</option>
		       			<c:forEach items="${ffList }" var="list">
		       				<c:if test="${list.ffParentId==2 }">
		       					<option value="${list.ffId }">${list.ffName }</option>
		       				</c:if>
		           		</c:forEach>
					</select>
				</span>
           </div>
           <div class="col-1"> </div>
           <label class="form-label col-1"><span class="c-red">*</span>种类：</label>
           <div class="formControls col-2">
           		<span class="select-box" style="width:150px;">
		            <select id="fSpecies" name="fSpecies" class="select" datatype="*">
		       			<option value="">请选择</option>
		       			<c:forEach items="${ffList }" var="list">
		       				<c:if test="${list.ffParentId==4 }">
		       					<option value="${list.ffId }">${list.ffName }</option>
		       				</c:if>
		           		</c:forEach>
					</select>
				</span>
           </div>
           <div class="col-1"> </div>
       </div>
       <div class="row cl">
       	   <label class="form-label col-1"><span class="c-red">*</span>克重范围：</label>
           <div class="formControls col-2">
           		<span class="select-box" style="width:150px;">
		            <select id="fG" name="fG" class="select" datatype="*">
		       			<option value="">请选择</option>
		       			<c:forEach items="${ffList }" var="list">
		       				<c:if test="${list.ffParentId==3 }">
		       					<option value="${list.ffId }">${list.ffName }</option>
		       				</c:if>
		           		</c:forEach>
					</select>
				</span>
           </div>
           <div class="col-1"> </div>
           <label class="form-label col-1"><span class="c-red">*</span>是否发布：</label>
           <div class="formControls col-2">
           		<span class="select-box" style="width:150px;">
		            <select id="fSendState" name="fSendState" class="select" datatype="*">
		       			<option value="">请选择</option>
		       			<option value="0">否</option>
		       			<option value="1">是</option>
					</select>
				</span>
           </div>
           <div class="col-1"> </div>
       </div>
       <div class="row cl">
       	   <label class="form-label col-1"><span class="c-red">*</span>厚度：</label>
           <div class="formControls col-2">
           		<span class="select-box" style="width:150px;">
		            <select id="fThickness" name="fThickness" class="select" datatype="*">
		       			<option value="">请选择</option>
		       			<option value="1">1分</option>
		       			<option value="2">2分</option>
		       			<option value="3">3分</option>
		       			<option value="4">4分</option>
		       			<option value="5">5分</option>
					</select>
				</span>
           </div>
           <div class="col-1"> </div>
           <label class="form-label col-1"><span class="c-red">*</span>光度：</label>
           <div class="formControls col-2">
           		<span class="select-box" style="width:150px;">
		            <select id="fPhotometric" name="fPhotometric" class="select" datatype="*">
		       			<option value="">请选择</option>
		       			<option value="1">1分</option>
		       			<option value="2">2分</option>
		       			<option value="3">3分</option>
		       			<option value="4">4分</option>
		       			<option value="5">5分</option>
					</select>
				</span>
           </div>
           <div class="col-1"> </div>
       </div>
       <div class="row cl">
       	   <label class="form-label col-1"><span class="c-red">*</span>柔软度：</label>
           <div class="formControls col-2">
           		<span class="select-box" style="width:150px;">
		            <select id="fSoft" name="fSoft" class="select" datatype="*">
		       			<option value="">请选择</option>
		       			<option value="1">1分</option>
		       			<option value="2">2分</option>
		       			<option value="3">3分</option>
		       			<option value="4">4分</option>
		       			<option value="5">5分</option>
					</select>
				</span>
           </div>
           <div class="col-1"> </div>
           <label class="form-label col-1"><span class="c-red">*</span>弹性：</label>
           <div class="formControls col-2">
           		<span class="select-box" style="width:150px;">
		            <select id="fElastic" name="fElastic" class="select" datatype="*">
		       			<option value="">请选择</option>
		       			<option value="1">1分</option>
		       			<option value="2">2分</option>
		       			<option value="3">3分</option>
		       			<option value="4">4分</option>
		       			<option value="5">5分</option>
					</select>
				</span>
           </div>
           <div class="col-1"> </div>
       </div>
       <div class="row cl">
       	   <label class="form-label col-1"><span class="c-red">*</span>吸水性：</label>
           <div class="formControls col-2">
           		<span class="select-box" style="width:150px;">
		            <select id="fAbsorption" name="fAbsorption" class="select" datatype="*">
		       			<option value="">请选择</option>
		       			<option value="1">1分</option>
		       			<option value="2">2分</option>
		       			<option value="3">3分</option>
		       			<option value="4">4分</option>
		       			<option value="5">5分</option>
					</select>
				</span>
           </div>
           <div class="col-1"> </div>
           <label class="form-label col-1"><span class="c-red">*</span>透气度：</label>
           <div class="formControls col-2">
           		<span class="select-box" style="width:150px;">
		            <select id="fBreathable" name="fBreathable" class="select" datatype="*">
		       			<option value="">请选择</option>
		       			<option value="1">1分</option>
		       			<option value="2">2分</option>
		       			<option value="3">3分</option>
		       			<option value="4">4分</option>
		       			<option value="5">5分</option>
					</select>
				</span>
           </div>
           <div class="col-1"> </div>
       </div>
       <div class="row cl">
       	   <label class="form-label col-1"><span class="c-red">*</span>易皱性：</label>
           <div class="formControls col-2">
           		<span class="select-box" style="width:150px;">
		            <select id="fFold" name="fFold" class="select" datatype="*">
		       			<option value="">请选择</option>
		       			<option value="1">1分</option>
		       			<option value="2">2分</option>
		       			<option value="3">3分</option>
		       			<option value="4">4分</option>
		       			<option value="5">5分</option>
					</select>
				</span>
           </div>
           <div class="col-1"> </div>
           <label class="form-label col-1"><span class="c-red">*</span>透明度：</label>
           <div class="formControls col-2">
           		<span class="select-box" style="width:150px;">
		            <select id="fTransparent" name="fTransparent" class="select" datatype="*">
		       			<option value="">请选择</option>
		       			<option value="1">1分</option>
		       			<option value="2">2分</option>
		       			<option value="3">3分</option>
		       			<option value="4">4分</option>
		       			<option value="5">5分</option>
					</select>
				</span>
           </div>
           <div class="col-1"> </div>
       </div>
       <div class="row cl">
	       <label class="form-label col-1"><span class="c-red">*</span>供应商（中文）：</label>
	      <div class="formControls col-2">
               <input type="text" class="input-text" id="fMessage3" name="fMessage3" datatype="*" nullmsg="供应商不能为空">
          </div>
          <div class="col-1"> </div>
          <label class="form-label col-1"><span class="c-red">*</span>供应商（英文）：</label>
	      <div class="formControls col-2">
               <input type="text" class="input-text" id="fMessage4" name="fMessage4" datatype="*" nullmsg="供应商不能为空">
           </div>
           <div class="col-1"> </div>
       </div>
       <div class="row cl">
	       <label class="form-label col-1"><span class="c-red">*</span>展示图片：</label>
	       <input type="hidden" id="returnImg" name="fImg" value="">
	       <div class="formControls col-2">  
		      <div class="uploader-thum-container">    
			      <div id="fileList" class="uploader-list"></div>
			      <div id="filePicker">选择图片</div>
		      </div>
	       </div>
       </div>
       <div class="row cl">
	    	<label class="form-label col-1"><span class="c-red">*</span>颜色图片:</label>
	    	<input type="hidden" name="returnImgArray1" value="">
	    	<div class="formControls col-7" id="returnImgArray1">
			</div>
			<div class="col-1"> </div>
	    </div>
       <div class="row cl">
	    	<label class="form-label col-1"><span class="c-red"></span></label>
	    	<div class="formControls col-7">
	    		<a class="btn btn-primary" style="display: inline;" onclick="member_add_full('颜色图片上传','../fabric/uploadImg?domId=returnImgArray1')">颜色图片上传</a>
			</div>
			<div class="col-1"> </div>
	    </div>
       <div class="row cl">
	    	<label class="form-label col-1">详情图片:</label>
	    	<input type="hidden" name="returnImgArray" value="">
	    	<div class="formControls col-7" id="returnImgArray">
			</div>
			<a id="aaId" onclick="aa()"></a>
			<div class="col-1"> </div>
	    </div>
       <div class="row cl">
	    	<label class="form-label col-1"><span class="c-red"></span></label>
	    	<div class="formControls col-7">
	    		<a class="btn btn-primary" style="display: inline;" onclick="member_add_full('详情图片上传','../fabric/uploadImg?domId=returnImgArray')">详情图片上传</a>
			</div>
			<div class="col-1"> </div>
	    </div>
       <div class="row cl">
       	 <div class="col-9 col-offset-3">
	         <a class="btn btn-primary save"  onclick="operationdataValidate('../fabric/save','#add_Fabric_Form')">保存</a>
	         <a class="btn btn-primary" onclick="closethis()">取消</a>
         </div>
       </div>
	</form>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/icheck/jquery.icheck.min.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/js/H-ui.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/js/H-ui.admin.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/lib/webuploader/0.1.5/webuploader.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/uploadSingleImg.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/jqthumb/jqthumb.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/h-ui/tableBtnGroup.js"></script>
<script type="text/javascript">

/* $(function(){
	
}); */

function aa(){
	$('.jqthumb').jqthumb({
        width: 150,
        height: 150
    });
}

function operationdataValidate(dataUrl,formId){
	var returnImg=$('#returnImg').val();
	var color =$("[name='returnImgArray1']").val();
	if(returnImg==''){
		alert("请上传展示图片");
		return false;
	}else if(color==null||color==""){
		alert("请上传颜色图片");
		return false;
	}else{
		operationdata(dataUrl,formId);
	}
}

function closethis(){
	var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
   	parent.layer.close(index);
}
</script>
</body>
</html>